package com.suray.system.run.data.mysql.device.task;

import com.baomidou.mybatisplus.core.conditions.query.LambdaQueryWrapper;
import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.suray.system.run.data.mysql.device.entity.DeviceTaskInfoDB;
import org.springframework.stereotype.Service;

import javax.annotation.Resource;
import java.util.List;

@Service
public class DeviceTaskInfoDBServiceImpl extends ServiceImpl<DeviceTaskInfoDBMapper, DeviceTaskInfoDB>
        implements DeviceTaskInfoDBService {

    @Resource
    DeviceTaskInfoDBMapper rgvInfoDBMapper;

    public DeviceTaskInfoDB findeDeviceTaskInfoDBBySeries(String series) {
        LambdaQueryWrapper<DeviceTaskInfoDB> eq = new QueryWrapper<DeviceTaskInfoDB>().lambda()
                .eq(DeviceTaskInfoDB::getSeries, series);

        List<DeviceTaskInfoDB> deviceTaskInfoDBS = this.list(eq);
        if (deviceTaskInfoDBS.size() == 0) {
            return null;
        }
        return deviceTaskInfoDBS.get(0);
    }
}
